package test;

import ch.ethz.fcl.R;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

public class HideStatusBar extends Activity{
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) 
	{
	    super.onCreate(savedInstanceState);
	    requestWindowFeature(Window.FEATURE_NO_TITLE);
	    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
	    setContentView(R.layout.layout_ip);    
	    View view = this.findViewById(R.id.edittext_ipaddress);
	    view.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);

//	    Thread background = new Thread (new Runnable() 
//	    {
//	       public void run() 
//	        {
//	            try
//	            {
//	                Thread.sleep(4000);
//	                progressHandler.sendMessage(progressHandler.obtainMessage());
//
//	            } 
//	            catch (InterruptedException e)
//	            {
//	                // TODO Auto-generated catch block
//	                e.printStackTrace();
//	            }
//	       }
//	    });
//
//	    // start the background thread
//	    background.start();
	}

	// handler for the background updating
	Handler progressHandler = new Handler() 
	{
	    public void handleMessage(Message msg) 
	    {
	        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
	    }
	};
}
